﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace AwesomeGame.Weapons.Pickups
{
    public class WeaponPickup
    {
        public WeaponType Weapon;
        public Vector2 Position;

        private Texture2D _sprite;

        private Vector2 _spriteMidpoint;

        public WeaponPickup(WeaponType weapon, Vector2 position)
        {
            Weapon = weapon;
            Position = position;
            if (weapon == WeaponType.BouncyBullet)
                _sprite = Game1.ContentManager.Load<Texture2D>(@"Weapons\BouncyBulletPickup");
            else if (weapon == WeaponType.Bullet)
                _sprite = Game1.ContentManager.Load<Texture2D>(@"Weapons\BulletPickup");
            else if (weapon == WeaponType.Rocket) 
                _sprite = Game1.ContentManager.Load<Texture2D>(@"Weapons\RocketPickup");

            _spriteMidpoint = new Vector2(_sprite.Width / 2, _sprite.Height / 2);
        }

        public Rectangle GetCollisionRectangle()
        {
            return new Rectangle((int)Position.X, (int)Position.Y, _sprite.Width, _sprite.Height);
        }

        public void Update(GameTime gameTime)
        {
        }

        public void Draw(GameTime gameTime)
        {
            Vector2 screenPosition = Camera.GetScreenPosition(Position);
            Game1.SpriteBatch.Draw(_sprite, screenPosition, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0.8f);
        }
    }
}
